gtk_widget_get_preferred_height_for_width (widget, size, minimum, natural);
}
+static void
+get_padding_and_border (GtkNotebook *notebook,
+ GtkBorder *border)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
+ gtk_style_context_get_padding (context, 0, border);
+
+ if (notebook->priv->show_border || notebook->priv->show_tabs)
+ {
+ GtkBorder tmp;
+
+ gtk_style_context_get_border (context, 0, &tmp);
+ border->top += tmp.top;
+ border->right += tmp.right;
+ border->bottom += tmp.bottom;
+ border->left += tmp.left;
+ }
+}
+
static void
gtk_notebook_size_request (GtkWidget *widget,
GtkOrientation orientation,
if (priv->show_border || priv->show_tabs)
{
- GtkStyleContext *context;
GtkBorder notebook_padding;
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_get_padding (context, 0, ¬ebook_padding);
+ get_padding_and_border (notebook, ¬ebook_padding);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
if (priv->show_tabs || priv->show_border)
{
- GtkStyleContext *context;
GtkBorder padding;
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_get_padding (context, 0, &padding);
+ get_padding_and_border (notebook, &padding);
child_allocation.x += padding.left;
child_allocation.y += padding.top;
GtkAllocation allocation;
GtkWidget *widget;
GtkNotebookPage *page;
- GtkStyleContext *context;
GdkRectangle redraw_rect;
gint border;
gint tab_pos = get_effective_tab_pos (notebook);
gtk_widget_get_allocation (widget, &allocation);
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_get_padding (context, 0, &padding);
+ get_padding_and_border (notebook, &padding);
switch (tab_pos)
{
GtkNotebookPrivate *priv = notebook->priv;
GtkAllocation allocation, action_allocation;
GtkWidget *widget;
- GtkStyleContext *context;
GList *children;
gint tab_pos = get_effective_tab_pos (notebook);
gint tab_overlap;
children = priv->children;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
- context = gtk_widget_get_style_context (widget);
-
gtk_widget_style_get (GTK_WIDGET (notebook),
"arrow-spacing", &arrow_spacing,
"scroll-arrow-hlength", &scroll_arrow_hlength,
NULL);
border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook));
- gtk_style_context_get_padding (context, 0, &padding);
+ get_padding_and_border (notebook, &padding);
gtk_widget_get_allocation (widget, &allocation);